<template>
  <!-- 完善我的简历弹框 -->
  <el-dialog 
  :visible.sync="visible" class="perfect_dialog"
  @close="cancel"
  title="添加简历信息" :close-on-click-modal="false" 
  :close-on-press-escape="false" :append-to-body="true">
    <el-form :model="saveResumeDtoList"  label-width="125px">
        <el-form-item label="开始年份：">
            <el-input v-model="saveResumeDtoList.startParty"></el-input>
        </el-form-item>
        <el-form-item label="结束年份:">
            <el-input v-model="saveResumeDtoList.endParty"></el-input>
        </el-form-item>
        <el-form-item label="阶段:">
            <el-input v-model="saveResumeDtoList.stage"></el-input>
        </el-form-item>
        <el-form-item label="地址:">
            <el-input v-model="saveResumeDtoList.address"></el-input>
        </el-form-item>
        <el-form-item label="学校名称:">
            <el-input v-model="saveResumeDtoList.schoolName"></el-input>
        </el-form-item>
        <el-form-item label="证明人:">
            <el-input v-model="saveResumeDtoList.certifier"></el-input>
        </el-form-item>
    </el-form>
    <div class="perfect_btn">
        <el-button type="primary" @click="addperfect">添加</el-button>
        <el-button @click="cancel">取消</el-button>
    </div>
  </el-dialog>
</template>

<script>
export default {
    data(){
        return{
            visible:false,
            saveResumeDtoList:{

            }
        }
    },
    mounted(){},
    methods:{
        init () {
            this.visible = true
            this.$nextTick(() => {
            })
        },
        addperfect(){//点击确认按钮
            var shuju=[]
            shuju[0] = this.saveResumeDtoList
            this.axios({
                headers:{'Authentication':localStorage.getItem('token')},
                method:"post",
                // url:"api/resume/saveUserResume",
                url:"/resume/saveUserResume",
                data:shuju
            }).then(res=>{
                // console.log(res)
                if(res.data.code != 20001){
                    return this.$message.error(res.data.msg)
                }
                this.$alert('添加成功',{
                    confirmButtonText:'确定',
                    callback:action=>{
                        this.visible = false
                        this.saveResumeDtoList = {}
                        this.$emit('Notestion')
                    }
                })
            })
        },
        cancel(){//点击取消按钮
            this.saveResumeDtoList = {}
            this.visible = false
        }
    }
}
</script>

<style lang="scss">
    .perfect_dialog{
        .el-dialog{
            height: 78vh;
        }
        .perfect_btn{
            text-align: center;
            position: absolute;
            bottom: 5vh;
            left: 0;
            width: 100%;
        }
    }
</style>